﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace ItsPdfUtils
{
	public class CertificateItem
	{
		public readonly X509Certificate2 Certificate;
		public CertificateItem(X509Certificate2 cert)
		{
			Certificate = cert;
		}
		public override string ToString()
		{
			return String.Format("{0}{1}, {2}",
				Certificate.GetNameInfo(X509NameType.SimpleName, false),
				string.IsNullOrWhiteSpace(Certificate.FriendlyName) ? "" : " (" + Certificate.FriendlyName+")",
				Certificate.GetNameInfo(X509NameType.SimpleName, true));
		}
	}
}
